import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path:'/',
      redirect:'/login'
    },
    { path: '/login', component: () => import('@/views/loginPage.vue') }, // 登录页
    {
      path: '/layout',
      component: () => import('@/views/layoutContainer.vue'),
      redirect: '/layout/users',
      children: [
        {
          path: '/layout/users',
          component: () => import('@/views/usersPage.vue')
        },
        {
          path: '/layout/message',
          component: () => import('@/views/messagePage.vue')
        },
        {
          path: '/layout/config',
          component: () => import('@/views/configPage.vue')
        },
        {
          path:'/layout/error.vue',
          component:()=>import('@/views/error.vue')
        }
      ]
    }
  ]
})

export default router
